package cn.edu.hhtc.stsystem.security.utils;

/**
 * 用户id本地线程.
 * 
 * @author linyueqin
 * 
 */
public class ThreadLocalRoleId {

	private static ThreadLocal<Long> roleIdThread = new ThreadLocal<Long>();

	public static long getRoleId() {
		try {
			return roleIdThread.get();
		} catch (Exception e) {
			return 0L;
		}
	}

	public static void setRoleId(long roleId) {
		roleIdThread.set(roleId);
	}
}
